package com.app.shop.demo.activitys;

import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.TextView;
import android.widget.VideoView;

import com.app.shop.demo.R;
import com.app.shop.mylibrary.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

public class VideoActivity extends BaseActivity {

    @BindView(R.id.tv_title)
    TextView tvTitle;

    @BindView(R.id.video_view)
    VideoView video_view;







    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video);
        ButterKnife.bind(this);
        initData();

    }

    private void initData() {


//        tvTitle.setText(bean.name);
        tvTitle.setText("视频详情");
        Uri uri = Uri.parse("android.resource://" + VideoActivity.this.getPackageName() + "/" + R.raw.v1);
        video_view.setMediaController(new MediaController(VideoActivity.this));
        video_view.setVideoURI(uri);
        video_view.start();
        video_view.requestFocus();

    }


}
